import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/hellowServlet")
//注解：赋予这个类额外的属性，把当前的类和http的请求路径关联起来
public class HellowServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //super.doGet(req, resp);这里只是显示一个错误页面
        System.out.println("hello Servlet");//这个会在服务器控制台里打印
        //
        resp.getWriter().write("hello Servlet");//把打印返回到客户端中
    }
}
